package main

func isPalindrome(x int) bool {
	if x < 0 {
		return false
	}
	var list []int
	for {
		v := x % 10
		x = x / 10
		list = append(list, v)
		if x == 0 {
			break
		}
	}
	length := len(list) - 1
	for ll := 0; ll <= length; ll++ {
		lr := length - ll
		if ll > lr {
			break
		}
		if list[ll] != list[lr] {
			return false
		}
	}
	return true
}
